import { defHttp } from '/@/utils/http/axios';

enum Api {
  GetPermissionList = '/permission/list',
  CreatePermission = '/permission/create',
  UpdatePermission = '/permission/update',
  DeletePermission = '/permission/del',
  GetPermissionDetail = '/permission/detail',
  GetListByRoleName = '/permission/getListByRoleName',
}

export class permissionsApi {
  static async getPermissionList(params) {
    return defHttp.get({ url: Api.GetPermissionList, params });
  }
  static async createPermission(data) {
    return defHttp.post({ url: Api.CreatePermission, data });
  }
  static async updatePermission(data) {
    return defHttp.post({ url: Api.UpdatePermission, data });
  }
  static async deletePermission(data) {
    return defHttp.post({ url: Api.DeletePermission, data });
  }
  static async getPermissionDetail(params) {
    return defHttp.get({ url: Api.GetPermissionDetail, params });
  }
  static async getListByRoleName(data) {
    return defHttp.post({ url: Api.GetListByRoleName, data });
  }
}
